/***********************************************************************
 * Module:  TestSection.java
 * Author:  DAC
 * Purpose: Defines the Class TestSection
 ***********************************************************************/
package com.group1.model;

/** @pdOid d8f61b40-cb66-420b-b50c-4fdaccf1ecb9 */
public class TestSection {
   /** @pdOid 1ba974fd-989e-4f68-b440-7f7c8d2de486 */
   public long testsecId;
   /** @pdOid 18612d1e-715c-419e-a49f-4910fc33506b */
   public java.lang.String testsecName;
   /** @pdOid 70fc4d9b-6e7b-4c6a-b4e5-12c12323afc2 */
   public java.lang.String testsecNote;
   
   /** @pdRoleInfo migr=no name=TestItem assc=testItemInsideOfATest coll=java.util.Collection impl=java.util.HashSet mult=0..* */
   public java.util.Collection<TestItem> testItem;
   /** @pdRoleInfo migr=no name=Test assc=testSectionInsideOfATest mult=0..1 side=A */
   public Test test;
   
   /** @pdOid eb38e46c-9118-4109-a5b3-1ea8477087e6 */
   public long getTestsecId() {
      return testsecId;
   }
   
   /** @param newTestsecId
    * @pdOid 7d575674-5d4a-456e-bfbb-e9f51d22c756 */
   public void setTestsecId(long newTestsecId) {
      testsecId = newTestsecId;
   }
   
   /** @pdOid 8cbf29d8-e63d-4a02-ab64-b25e46e34032 */
   public java.lang.String getTestsecName() {
      return testsecName;
   }
   
   /** @param newTestsecName
    * @pdOid 44adf54d-e8e2-4b6f-9f16-ea4f41e93eae */
   public void setTestsecName(java.lang.String newTestsecName) {
      testsecName = newTestsecName;
   }
   
   /** @pdOid 281039e6-6397-4642-bef2-ab9df7d6b96c */
   public java.lang.String getTestsecNote() {
      return testsecNote;
   }
   
   /** @param newTestsecNote
    * @pdOid 5bb67208-f09b-43c2-bbc0-cbadc80d33b3 */
   public void setTestsecNote(java.lang.String newTestsecNote) {
      testsecNote = newTestsecNote;
   }
   
   
   /** @pdGenerated default getter */
   public java.util.Collection<TestItem> getTestItem() {
      if (testItem == null)
         testItem = new java.util.HashSet<TestItem>();
      return testItem;
   }
   
   /** @pdGenerated default iterator getter */
   public java.util.Iterator getIteratorTestItem() {
      if (testItem == null)
         testItem = new java.util.HashSet<TestItem>();
      return testItem.iterator();
   }
   
   /** @pdGenerated default setter
     * @param newTestItem */
   public void setTestItem(java.util.Collection<TestItem> newTestItem) {
      removeAllTestItem();
      for (java.util.Iterator iter = newTestItem.iterator(); iter.hasNext();)
         addTestItem((TestItem)iter.next());
   }
   
   /** @pdGenerated default add
     * @param newTestItem */
   public void addTestItem(TestItem newTestItem) {
      if (newTestItem == null)
         return;
      if (this.testItem == null)
         this.testItem = new java.util.HashSet<TestItem>();
      if (!this.testItem.contains(newTestItem))
      {
         this.testItem.add(newTestItem);
         newTestItem.setTestSection(this);      
      }
   }
   
   /** @pdGenerated default remove
     * @param oldTestItem */
   public void removeTestItem(TestItem oldTestItem) {
      if (oldTestItem == null)
         return;
      if (this.testItem != null)
         if (this.testItem.contains(oldTestItem))
         {
            this.testItem.remove(oldTestItem);
            oldTestItem.setTestSection((TestSection)null);
         }
   }
   
   /** @pdGenerated default removeAll */
   public void removeAllTestItem() {
      if (testItem != null)
      {
         TestItem oldTestItem;
         for (java.util.Iterator iter = getIteratorTestItem(); iter.hasNext();)
         {
            oldTestItem = (TestItem)iter.next();
            iter.remove();
            oldTestItem.setTestSection((TestSection)null);
         }
      }
   }
   /** @pdGenerated default parent getter */
   public Test getTest() {
      return test;
   }
   
   /** @pdGenerated default parent setter
     * @param newTest */
   public void setTest(Test newTest) {
      if (this.test == null || !this.test.equals(newTest))
      {
         if (this.test != null)
         {
            Test oldTest = this.test;
            this.test = null;
            oldTest.removeTestSection(this);
         }
         if (newTest != null)
         {
            this.test = newTest;
            this.test.addTestSection(this);
         }
      }
   }

}